//app.js
App({
  onLaunch: function () {
    var that = this;
   wx.login({
     success:function(res){
       console.log(res);
       that.globalData.code = res.code
     }
   })
  },
  globalData: {
    userInfo: null,
    code:""
  }
})